package controller

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"go-web-lib/module"
)

type User struct {
	module.Base
}

func NewUser() *User {
	return &User{}
}


func init() {

	u :=&User{}
	module.Register(u,"user").
		WithGroup("user/v1").
		WithMethod(module.PUT).
		WithPath("query:id").
		WithHandlerFunc(u.HelloWorld)

	module.Register(u,"user").WithGroup("user/v1").
		WithMethod(module.GET).
		WithPath("query:name").
		WithHandlerFunc(u.HelloWorld)




	module.PrintModule()

}

func (t *User)HelloWorld(ctx *gin.Context) {

	fmt.Println("hello world")
}